﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace GameObjects
{
    public class PlayerMove2 : GameObjects.IMoveBehavior
    {
        Character _character;

        public Character Character
        {
            get { return _character; }
            set { _character = value; }
        }

        public PlayerMove2(Character character)
        {
            this._character = character;
        }

        public void Move()
        {
            KeyboardState keyboardState = Keyboard.GetState();
            if (keyboardState.IsKeyDown(Keys.A))
                _character.Position.X -= _character.Speed;
            if (keyboardState.IsKeyDown(Keys.D))
                _character.Position.X += _character.Speed;
            if (keyboardState.IsKeyDown(Keys.W))
                _character.Position.Y -= _character.Speed;
            if (keyboardState.IsKeyDown(Keys.S))
                _character.Position.Y += _character.Speed;
        }
    }
}
